<?php echo $this->Form->create('Projeto'); ?>
<div class="row-fluid">
	<div class="control-group span12 <?php echo ($this->Form->isFieldError('nome')) ? 'error' : ''; ?>">
		<?php echo $this->Form->Label('nome', 'Projeto', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('nome', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span12', 'required' => false, 'placeholder' => 'Título do projeto', 'error' => false));	?>
			<?php echo $this->Form->error('nome', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
</div>
<div class="row-fluid">
	<div class="control-group span12 <?php echo ($this->Form->isFieldError('coordenador_id')) ? 'error' : ''; ?>">
		<?php echo $this->Form->Label('coordenador_id', 'Coordenador', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('coordenador_id', array('options' => $professores, 'empty' => true, 'label' => false, 'div' => false, 'class' => 'span12', 'error' => false));	?>
			<?php echo $this->Form->error('coordenador_id', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
</div>
<div class="row-fluid">
	<div class="control-group span6<?php echo ($this->Form->isFieldError('data_inicio')) ? ' error' : ''; ?>">
		<?php echo $this->Form->Label('data_inicio', 'Data de Início', array('class' => 'control-label'));	?>
		<div class="controls">
			<div class="input-append span10">
				<?php echo $this->Form->input('data_inicio', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span12', 'required' => false, 'placeholder' => "Início do projeto", 'error' => false)); ?>
				<span class="add-on"><i class="icon-calendar"></i></span>
			</div>
			<?php echo $this->Form->error('data_inicio', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
	<div class="control-group span6 <?php echo ($this->Form->isFieldError('data_termino')) ? 'error' : ''; ?>">
		<?php echo $this->Form->Label('data_termino', 'Data do Término', array('class' => 'control-label'));	?>
		<div class="controls">
			<div class="input-append span10">
				<?php echo $this->Form->input('data_termino', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span12', 'required' => false, 'placeholder' => "Término do projeto", 'error' => false)); ?>
				<span class="add-on"><i class="icon-calendar"></i></span>
			</div>
			<?php echo $this->Form->error('data_termino', null, array('wrap' => 'span', 'class' => 'help-block')); ?>
		</div>
	</div>
</div>
<div class="row-fluid">
	<div class="control-group span12">
		<?php echo $this->Form->Label('descricao_resumida', 'Descrição resumida', array('class' => 'control-label'));	?>
		<div class="controls">
			<?php echo $this->Form->input('descricao_resumida', array('type' => 'textarea', 'rows' => 3, 'label' => false, 'div' => false, 'class' => 'span12', 'required' => false, 'placeholder' => "Descreva resumidamente do que se trata o projeto"));	?>
		</div>
	</div>
</div>
<?php echo $this->Form->hidden('id'); ?>
<?php echo $this->Form->end(); ?>

<script type="text/javascript">
	$(document).ready(function () {
		$('#ProjetoDataInicio').mask('99/99/9999').datepicker();
		$('#ProjetoDataTermino').mask('99/99/9999').datepicker();
		$('#ProjetoCoordenadorId').select2({placeholder: 'Selecione o coordenador do projeto...'});
	});
</script>